<template>
  <div
    :class="[
      type !== 'PresentContent' && type !== 'changeInfo' && type !== 'biddingInformation'
        ? 'enterprise-details-container'
        : 'PresentContent',
    ]"
  >
    <!-- 工商信息 -->
    <BusinessCircles v-if="type == 'businessCircles'" :dataInfo="dataInfo" />
    <!-- 主要人员 -->
    <KeyPersonnel v-if="type == 'keyPersonnel'" :dataInfo="dataInfo" :type="type" />
    <!-- 股东信息 -->
    <ShareholderInfo v-if="type === 'shareholderInfo'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 变更记录 -->
    <ChangeRecord v-if="type == 'changeInfo'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 经营许可 -->
    <ManageInfo v-if="type === 'manageInfo'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 招投标信息 -->
    <BiddingInformation v-if="type == 'biddingInformation'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 资质证书 -->
    <Credential v-if="type == 'credential'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 对外投资 -->
    <OutboundInvestment v-if="type == 'outboundInvestment'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 分支机构 -->
    <Branch v-if="type == 'branch'" :vantListGather="vantListGather" @onLoad="onLoad" />
    <!-- 总公司 -->
    <ParentCompany v-if="type == 'parentCompany'" :parentCompanyObj="parentCompanyObj" />
    <!-- 自身风险 -->
    <RiskDetails v-if="type == 'ownRisk'" :data="riskList[0]" :title="riskTitle" />
    <!-- 周边风险 -->
    <RiskDetails v-if="type == 'peripheryRisk'" :data="riskList[1]" :title="riskTitle" />
    <!-- 历史风险 -->
    <RiskDetails v-if="type == 'historicalRisk'" :data="riskList[2]" :title="riskTitle" />
    <!-- 预警提示 -->
    <RiskDetails v-if="type == 'alertPrompt'" :data="riskList[3]" :title="riskTitle" />
    <!-- 最短路径呈现内容 -->
    <PresentContent v-if="type == 'PresentContent'" ref="presentContent"/>
  </div>
</template>

<script>
import BusinessCircles from "./basicDetails/BusinessCircles"; //工商信息
import KeyPersonnel from "./basicDetails/KeyPersonnel"; //主要人员
import ShareholderInfo from "./basicDetails/ShareholderInfo"; //股东信息
import ManageInfo from "./basicDetails/ManageInfo"; //经营许可
import Credential from "./basicDetails/Credential"; //资质证书
import BiddingInformation from "./basicDetails/BiddingInformation"; //招投标信息
import ChangeRecord from "./basicDetails/ChangeRecord"; //变更记录
import OutboundInvestment from "./investDetails/OutboundInvestment"; //对外投资
import Branch from "./investDetails/Branch"; //分支机构
import ParentCompany from "./investDetails/ParentCompany"; //总公司
import RiskDetails from "./riskDetails"; //风险情况
import PresentContent from "./ShortestPath"; //最短路径呈现内容
export default {
  name: "EnterpriseDetailsIndex",
  props: {
    type: {
      type: String,
      required: true,
    },
    riskTitle: String,
    dataInfo: Object,
    keyPersonData: Object,
    vantListGather: {
      type: Object,
      required: true,
    },
    riskList: Array,
    parentCompanyObj: Object,
  },
  components: {
    BusinessCircles,
    KeyPersonnel,
    ShareholderInfo,
    ManageInfo,
    Credential,
    OutboundInvestment,
    Branch,
    ParentCompany,
    RiskDetails,
    ChangeRecord,
    BiddingInformation,
    PresentContent,
  },
  methods: {
    /**
     * 加载下一页数据
     * @param {*} pageNum 页码
     */
    onLoad(pageNum) {
      this.$emit("onLoad", pageNum);
    },
  },
};
</script>

<style lang="less">
@import url("~@/assets/styles/resetComponentStyle.less");
@import url("~@/assets/styles/enterpriseDetails/index.less");
.PresentContent {
  flex: 1 !important;
}
</style>
